package com.jingbian.cppccbackend.service.admin;

import com.jingbian.cppccbackend.entity.Admins;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jingbian.cppccbackend.entity.Users;
import com.jingbian.cppccbackend.entity.vo.PageVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 管理员信息表 服务类
 * </p>
 *
 * @author yezi
 * @since 2025-02-09
 */

public interface AdminsService extends IService<Admins> {
    //查找管理员
    Admins findByAccount(String account);
    
    //获取用户列表
    List<Users> getUserlist();

    //修改用户
    boolean updateUser(Users user);
    
    //删除用户
    boolean deleteUser(Integer uid);


    Admins findById(Integer aid);

    PageVO<Users> getAllUsers(Integer pageNum, Integer pageSize, String searchText, String startDate, String endDate, String sortType, String status, String identity, String region, String affiliation, String others);

    PageVO<Users> getApproveUsers(Integer pageNum, Integer pageSize, String searchText, String startDate, String endDate, String sortType, String status, String identity, String region, String affiliation, String others);

    Users getUsersDetails(Integer uid);

    void updateStatus(Integer uid, String status);

    // 用户数据查询
    PageVO<Users> getUsers(Integer pageNum, Integer pageSize, String searchText, String startDate, String endDate,
                           String sortType, String status, String identity, String region, String affiliation, String ethnicity, String gender, String auditStatus);

    // 用户数据导出
    List<Users> getUsersForExport(String searchText, String startDate, String endDate, String sortType,
                                  String status, String identity, String region, String affiliation, String ethnicity, String gender, String auditStatus);

    boolean resetPassword(Integer uid, String newPassword);



    // 获取用户统计数据
    Map<String, Object> getUserStatistics();

    // 获取待审核用户数量
    int getPendingAuditCount();

    // 获取用户界别分布
    List<Map<String, Object>> getUserAffiliationDistribution();

    // 获取最近十天的用户注册趋势 - 修改为支持日期范围
    List<Map<String, Object>> getUserRegistrationTrend(String startDate, String endDate);

    String getDepartmentName(String departmentId);

    String getDepartmentName2(String departmentId);

    boolean updateUserScore(Integer uid, Double score);

    boolean clearAllScores();
}
